<template>
  <div id="app">
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive"></router-view>
  </div>
</template>

<script>
  import { utils_scrollToView } from "@/utils/index.js"
  export default {
    created() {
      this.setVH()
      utils_scrollToView()
    },
    methods: {
      // 移动端除去网址、状态栏的vh高度
      setVH() {
        document.documentElement.style.setProperty(
          '--vh',
          window.innerHeight * 0.01 + 'px'
        )
      }
    }
  }
</script>